<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="ctx" value="${pageContext.request.contextPath }"></c:set>
<!DOCTYPE html>
<html lang="en">
<c:import url="../common/header.jsp"></c:import>
<body class="hold-transition skin-blue sidebar-mini">
	<div class="wrapper">

		<c:import url="../common/nav.jsp"></c:import>

		<!-- Content Wrapper. Contains page content -->
		<div class="content-wrapper">
			<!-- Content Header (Page header) -->
			<section class="content-header">
				<h1>
					今日公司 <small></small>
				</h1>

			</section>

			<!-- Main content -->
			<section class="content">

				<!-- Your Page Content Here -->
				<div class="row">
					<div class="col-xs-12">

						<div class="box">
							<div class="box-header">

								<div class="row">
									<div class="col-sm-12">
										<div>
											<ol class="breadcrumb">
												<li><a href="#"><i class="fa fa-dashboard"></i> <c:if
															test="${queryType == 'list'}">所有
														</c:if> <c:if test="${queryType == 'zhaopin'}">智联招聘
														</c:if> <c:if test="${queryType == '58tc'}">58同城
														</c:if> <c:if test="${queryType == '51job'}">前程无忧
														</c:if> </a></li>
												<li class="active"><c:if test="${state == -1}">所有
													</c:if> <c:if test="${state == 1}">新增
													</c:if> <c:if test="${state == 0}">已查看
													</c:if></li>
											</ol>
										</div>

										<div class="col-sm-offset-1 col-sm-6">

											<div class="btn-toolbar" role="toolbar" aria-label="...">
												<div class="btn-group" role="group" aria-label="...">
													<a class="btn btn-info"
														href="${ctx}/company/today/list/-1/1">所有</a> <a
														class="btn  btn-info"
														href="${ctx}/company/today/zhaopin/-1/1">智联招聘</a> <a
														class="btn btn-info" href="${ctx}/company/today/58tc/-1/1">58同城</a>
													<a class="btn btn-info"
														href="${ctx}/company/today/51job/-1/1">前程无忧</a>

												</div>
												<div class="btn-group" role="group" aria-label="...">
													<a class="btn  btn-info"
														href="${ctx}/company/today/${queryType}/-1/1">所有</a> <a
														class="btn  btn-danger"
														href="${ctx}/company/today/${queryType}/1/1">新增</a> <a
														href="${ctx}/company/today/${queryType}/0/1"
														class="btn btn-primary">已查看</a>
												</div>

											</div>

										</div>

										<div class="navbar-right">
											<a href="${ctx }/company/today/${queryType}/${state}/excel"
												class="btn-lg"><button>导出 Excel</button></a>
										</div>
									</div>

								</div>

							</div>
							<!-- /.box-header -->
							<div class="box-body">

								<div class="row">
									<div class="col-sm-12">
										<table id="example2"
											class="table table-bordered table-hover dataTable"
											role="grid" aria-describedby="example2_info">
											<thead>
												<tr role="row">
													<th class="sorting_asc" tabindex="0"
														aria-controls="example2" rowspan="1" colspan="1"
														aria-label="userId: activate to sort column descending"
														aria-sort="ascending">公司Id</th>
													<th class="sorting" tabindex="0" aria-controls="example2"
														rowspan="1" colspan="1"
														aria-label="companyName: activate to sort column ascending">公司名称</th>
													<th class="sorting" tabindex="0" aria-controls="example2"
														rowspan="1" colspan="1"
														aria-label="publishTime: activate to sort column ascending">发布时间</th>
													<th class="sorting" tabindex="0" aria-controls="example2"
														rowspan="1" colspan="1"
														aria-label="queryType: activate to sort column ascending">来源</th>
												</tr>
											</thead>
											<tbody>
												<c:forEach var="company" items="${pagecompanys.list}">
													<tr role="row" class="odd">
														<td class="sorting_1">${company.companyId}</td>

														<td><span class="glyphicon glyphicon-star"
															aria-hidden="true"></span><a
															href="${company.companyDetailUrl}" target="_blank">${company.companyName}</a>

															<c:if test="${company.isnew == 1}">
																<button class="btn  btn-danger changestate"
																	url="${ctx}/company/today/state/${company.companyId}/0">新增</button>
															</c:if> <c:if test="${company.isnew ==0}">
																<button class="btn btn-primary">已查看</button>
															</c:if></td>
														<td>${company.queryTime}</td>
														<td>${company.queryType}</td>
													</tr>
												</c:forEach>
											</tbody>
										</table>
									</div>
								</div>
								<div class="row">
									<div class="col-sm-12">


										<nav aria-label="Page navigation">
											<ul class="pagination">
												<li><a
													href="${ctx }/company/today/${queryType}/${state}/1"
													aria-label=" 上一页" class="btn btn-lg"> <span
														aria-hidden="true">首页</span>
												</a></li>
												<li><a
													href="${ctx }/company/today/${queryType}/${state}/${pagecompanys.previousPage}"
													aria-label=" 上一页" class="btn btn-lg"> <span
														aria-hidden="true">上一页</span>
												</a></li>
												<li><a
													href="${ctx }/company/today/${queryType}/${state}/${pagecompanys.currentPage}"
													class="btn btn-lg">${pagecompanys.currentPage}</a></li>
												<li><a
													href="${ctx }/company/today/${queryType}/${state}/${pagecompanys.nextPage}"
													aria-label=" 下一页  " class="btn btn-lg"> <span
														aria-hidden="true">下一页 </span>
												</a></li>
												<li><a
													href="${ctx }/company/today/${queryType}/${state}/${pagecompanys.totalPage}"
													aria-label=" 上一页" class="btn btn-lg"> <span
														aria-hidden="true">末页</span>
												</a></li>
												<li><div class="btn btn-lg">总共
														${pagecompanys.totalPage}页</div></li>
											</ul>
										</nav>
									</div>
									<!-- <div class="col-sm-6"></div> -->
								</div>
							</div>

							<!-- /.box-body -->
						</div>

						<!-- 模态框（Modal） -->
						<div class="modal fade" id="myModal" tabindex="1" role="dialog"
							aria-labelledby="myModalLabel" aria-hidden="true">
							<div class="modal-dialog">
								<div class="modal-content">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal"
											aria-hidden="true">&times;</button>
										<h4 class="modal-title" id="myModalLabel">模态框（Modal）标题</h4>
									</div>
									<div class="modal-body">在这里添加一些文本</div>
									<div class="modal-footer">
										<button type="button" class="btn btn-default"
											data-dismiss="modal">关闭</button>
										<button type="button" class="btn btn-primary">提交更改</button>
									</div>
								</div>
								<!-- /.modal-content -->
							</div>
							<!-- /.modal -->

							<!-- /.box -->

							<!-- 						<div class="box">
							<div class="box-header">
								<h3 class="box-title">信息统计</h3>
							</div>
							/.box-header
							<div class="box-body"></div>
							/.box-body
						</div> -->


							<!-- /.box -->
						</div>
						<!-- /.col -->
					</div>
					<!-- /.row -->
			</section>
			<!-- /.content -->
		</div>
		<!-- /.content-wrapper -->

		<%-- 		<c:import url="../common/footer.jsp"></c:import> --%>

		<!-- jQuery 2.2.3 -->
		<script src="${ctx}/plugins/jQuery/jquery-2.2.3.min.js"></script>
		<!-- Bootstrap 3.3.6 -->
		<script src="${ctx}/bootstrap/js/bootstrap.min.js"></script>
		<!-- DataTables -->
		<script src="${ctx}/plugins/datatables/jquery.dataTables.min.js"></script>
		<script src="${ctx}/plugins/datatables/dataTables.bootstrap.min.js"></script>
		<!-- SlimScroll -->
		<script src="${ctx}/plugins/slimScroll/jquery.slimscroll.min.js"></script>
		<!-- FastClick -->
		<script src="${ctx}/plugins/fastclick/fastclick.js"></script>
		<!-- AdminLTE App -->
		<script src="${ctx}/dist/js/app.min.js"></script>
		<!-- AdminLTE for demo purposes -->
		<script src="${ctx}/dist/js/demo.js"></script>

		<!-- page script -->
		<script>
			$(function() {

				$("#example2").DataTable({
					paging : false
				});

				$(".changestate").click(function() {
					$.ajax({
						url : $(this).attr("url"),
						success : function(data) {
							//alert(data);
							window.location.reload();
						}
					});
				})

				/* 获取 button */

			});
		</script>
	</div>

</body>
</html>
